.class public Lcom/hyphenate/chat/EMKuaiyaLocation;
.super Ljava/lang/Object;


# static fields
.field public static final TAG:Ljava/lang/String; = "EMKuaiyaLocation"

.field static sInstance:Lcom/hyphenate/chat/EMKuaiyaLocation;


# instance fields
.field discoverTimer:Ljava/util/Timer;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/hyphenate/chat/EMKuaiyaLocation;->discoverTimer:Ljava/util/Timer;

    return-void
.end method

.method static declared-synchronized getInstance()Lcom/hyphenate/chat/EMKuaiyaLocation;
    .locals 2

    const-class v1, Lcom/hyphenate/chat/EMKuaiyaLocation;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/hyphenate/chat/EMKuaiyaLocation;->sInstance:Lcom/hyphenate/chat/EMKuaiyaLocation;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMKuaiyaLocation;

    invoke-direct {v0}, Lcom/hyphenate/chat/EMKuaiyaLocation;-><init>()V

    sput-object v0, Lcom/hyphenate/chat/EMKuaiyaLocation;->sInstance:Lcom/hyphenate/chat/EMKuaiyaLocation;

    :cond_0
    sget-object v0, Lcom/hyphenate/chat/EMKuaiyaLocation;->sInstance:Lcom/hyphenate/chat/EMKuaiyaLocation;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v1

    return-object v0

    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method


# virtual methods
.method init()V
    .locals 6

    const-string/jumbo v0, "EMKuaiyaLocation"

    const-string/jumbo v1, "init"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/hyphenate/chat/EMKuaiyaLocation;->discoverTimer:Ljava/util/Timer;

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->getCurrentUser()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/hyphenate/chat/EMKuaiyaLocation;->discoverTimer:Ljava/util/Timer;

    new-instance v2, Lcom/hyphenate/chat/EMKuaiyaLocation$1;

    invoke-direct {v2, p0, v0}, Lcom/hyphenate/chat/EMKuaiyaLocation$1;-><init>(Lcom/hyphenate/chat/EMKuaiyaLocation;Ljava/lang/String;)V

    const-wide/16 v4, 0x7530

    invoke-virtual {v1, v2, v4, v5}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    return-void
.end method

.method onDestroy()V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMKuaiyaLocation;->discoverTimer:Ljava/util/Timer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMKuaiyaLocation;->discoverTimer:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/hyphenate/chat/EMKuaiyaLocation;->discoverTimer:Ljava/util/Timer;

    :cond_0
    return-void
.end method
